package cn.yqn.downgrade;

import cn.yqn.domain.User;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @BelongsProject: springcloudalibaba-parent
 * @BelongsPackage: cn.itsource.downgrade
 * @Author: Director
 * @CreateTime: 2022-07-30  23:30
 * @Description: 服务降级类
 * @Version: 1.0
 */
public class DowngradeUtil {

    public static User degradationMethod(@PathVariable("id") Long id, BlockException e){
        e.printStackTrace();
        return new User(-1L, "服务降级触发！", "当前服务流量过大，请稍后重试！");
    }

}